package com.galaxy.samson.student.service;

import com.galaxy.samson.student.dao.IStudentDao;
import com.galaxy.samson.student.domain.Student;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: arunachalam
 * Date: 2/6/12
 * Time: 7:44 PM
 * To change this template use File | Settings | File Templates.
 */
@Transactional
public class StudentService implements IStudentService
{
    private IStudentDao studentDao;

    public IStudentDao getStudentDao()
    {
        return studentDao;
    }

    public void setStudentDao(IStudentDao studentDao)
    {
        this.studentDao = studentDao;
    }

    @Override
    public void insert(Student student)
    { studentDao.insert(student);

    }

    @Override
    public void removeAll()
    {
        studentDao.removeAll();
    }

    @Override
    public void remove(String registerNumber)
    {
        studentDao.remove(registerNumber);
    }

    @Override
    public List<Student> findAll()
    {
        return studentDao.findAll();
    }

    @Override
    public Student searchByRegisterNumber(String registerNumber)
    {
        return studentDao.searchByRegisterNumber(registerNumber);
    }

    @Override
    public Student searchByRollNumber(int rollNumber)
    {
        return studentDao.searchByRollNumber(rollNumber);
    }

    @Override
    public List<Student> searchByDepartment(String department)
    {
        return studentDao.searchByDepartment(department);
    }

    @Override
    public List<Student> searchByCity(String city)
    {
        return studentDao.searchByCity(city);
    }

    @Override
    public List<Student> searchByName(String name)
    {
        return studentDao.searchByName(name);
    }
}
